class Question < ActiveRecord::Base
  validates_presence_of :title,:content,:user_id,:tag_id
  has_many :answers
  belongs_to :user
  belongs_to :tag
  has_many :question_read_logs
  def Question.top_ten
    Question.order('read_num desc').limit(10)
  end
end
